package com.tsing.common.utils;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.tsing.common.vo.UserVo;

import java.time.Instant;

public class JwtUtil {

    public static String getToken(UserVo user) {
        return JWT.create().withAudience(user.getId() + Instant.now().toEpochMilli()).sign(Algorithm.HMAC256(user.getId()));
    }

}
